package com.hotau.util;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import android.os.Environment;

public class FileWriterUtil {

	public static void write2SdcardRoot(String resultResponse, String fileName)
			throws FileNotFoundException {
		File sharedDir = Environment.getExternalStorageDirectory();
		sharedDir.mkdirs();
		File file = new File(sharedDir, fileName);
		// 写文件
		FileOutputStream fos = new FileOutputStream(file);
		try {
			fos.write(resultResponse.toString().getBytes());
		} catch (Exception ex) {
			ex.printStackTrace();
		} finally {
			if (fos != null) {
				try {
					fos.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}

}
